﻿using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.WindowsAzure.StorageClient;
using SimplePoll.Web.DataAccess;

namespace SimplePoll.Web.Models
{
    public class Poll : TableServiceEntity
    {
        string name;

        public Poll() : this(string.Empty)
        {
        }

        public Poll(string name)
            : base("Polls", Guid.NewGuid().ToString())
        {
            this.name = name;
        }

        [Required]
        public string Answer1 { get; set; }

        [Required]
        public string Answer2 { get; set; }

        [Required]
        public string Answer3 { get; set; }

        [Required]
        public string Name
        {
            get { return name; }
            set
            {
                name = value;
                //PartitionKey = value.Encode();
            }
        }

        [Required]
        public string Question { get; set; }
    }
}